﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace Model
{
    /// <summary>
    /// 预算项目对象
    /// </summary>
    public partial class T_BudgetObject
    {
        private System.Int32 db_OID;
        private System.DateTime db_BeginDate;
        private System.DateTime db_EndDate;
        private System.Int32 db_PayCategory;
        private System.Decimal db_BudgetSum;
        private System.Decimal db_ReferValue;

        public System.Int32 Db_OID
        {
            get { return db_OID; }
            set { db_OID = value; }
        }
        public System.DateTime Db_BeginDate
        {
            get { return db_BeginDate; }
            set { db_BeginDate = value; }
        }
        public System.DateTime Db_EndDate
        {
            get { return db_EndDate; }
            set { db_EndDate = value; }
        }
        public System.Int32 Db_PayCategory
        {
            get { return db_PayCategory; }
            set { db_PayCategory = value; }
        }
        public System.Decimal Db_BudgetSum
        {
            get { return db_BudgetSum; }
            set { db_BudgetSum = value; }
        }
        public System.Decimal Db_ReferValue
        {
            get { return db_ReferValue; }
            set { db_ReferValue = value; }
        }

        public void Data2Object(DataRow value)
        {
            if (value["OID"] != DBNull.Value)
                db_OID = System.Int32.Parse(value["OID"].ToString());
            if (value["BeginDate"] != DBNull.Value)
                db_BeginDate = System.DateTime.Parse(value["BeginDate"].ToString());
            if (value["EndDate"] != DBNull.Value)
                db_EndDate = System.DateTime.Parse(value["EndDate"].ToString());
            if (value["PayCategory"] != DBNull.Value)
                db_PayCategory = System.Int32.Parse(value["PayCategory"].ToString());
            if (value["BudgetSum"] != DBNull.Value)
                db_BudgetSum = System.Decimal.Parse(value["BudgetSum"].ToString());
            if (value["ReferValue"] != DBNull.Value)
                db_ReferValue = System.Decimal.Parse(value["ReferValue"].ToString());
        }

        public DataRow Object2Data(ref DataRow value)
        {
            value["OID"] = db_OID;
            value["BeginDate"] = db_BeginDate;
            value["EndDate"] = db_EndDate;
            value["PayCategory"] = db_PayCategory;
            value["BudgetSum"] = db_BudgetSum;
            value["ReferValue"] = db_ReferValue;
            return value;
        }
    } // end of class
}
